package com.yanqu.road.entity.activity.args;

import com.yanqu.road.entity.activity.operamask.OperaMaskSceneData;
import com.yanqu.road.entity.activity.operamask.OperaMaskUserData;

public class OperaMaskSumScoreArgs {

    private long score;
    private String param;

    public OperaMaskSumScoreArgs() {
    }

    public static OperaMaskSumScoreArgs create(OperaMaskUserData userData) {
        OperaMaskSumScoreArgs args = new OperaMaskSumScoreArgs();
        long score = 0L;
        StringBuilder builder = new StringBuilder();
        for (OperaMaskSceneData sceneData : userData.getSceneDataMap().values()) {
            long tmpScore = sceneData.getScore();
            if (tmpScore > 0) {
                score += tmpScore;
                builder.append(sceneData.getId());
                builder.append("=");
                builder.append(tmpScore);
                builder.append(";");
            }
        }
        args.setScore(score);
        args.setParam(builder.toString());
        return args;
    }

    public long getScore() {
        return score;
    }

    public void setScore(long score) {
        this.score = score;
    }

    public String getParam() {
        return param;
    }

    public void setParam(String param) {
        this.param = param;
    }
}
